﻿using Microsoft.EntityFrameworkCore;
using MS.BasicData.Domain;
using MS.BasicData.Domain.Rabbit;
using MS.BasicData.Domain.Role_Based_Access_Control;


namespace MS.BasicData.Infrastructure
{
    /// <summary>
    /// UserDataDbconterxt
    /// </summary>
    public class UserDataDbconterxt : DbContext
    {
     public UserDataDbconterxt(DbContextOptions<UserDataDbconterxt> options) : base(options)
        {

        }

        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            base.OnModelCreating(modelBuilder);

            modelBuilder.Entity<UserInfo>()
                .HasQueryFilter(a => !a.IsDeleted);
        }

        /// <summary>
        ///产品表
        /// </summary>
        public DbSet<Product> Products { get; set; }
        /// <summary>
        /// 产品信息表
        /// </summary>
        public DbSet<ProductInfo> ProductInfos { get; set; }
        /// <summary>
        /// 养殖信息表
        /// </summary>
        public DbSet<Cultivation> Cultivations { get; set; }
        /// <summary>
        /// 企业信息表
        /// </summary>
        public DbSet<Enterprise> Enterprises { get; set; }
        /// <summary>
        /// 产品图片信息表
        /// </summary>
        public DbSet<PictureInfo> PictureInfos { get; set; }
        /// <summary>
        /// 用户信息表
        /// </summary>
        public DbSet<UserInfo> UserInfos { get; set; }
        /// <summary>
        /// 角色表
        /// </summary>
        public DbSet<Roles> Roles { get; set; }
        /// <summary>
        /// 权限表
        /// </summary>
        public DbSet<Permissions> Permissions { get; set; }
        /// <summary>
        /// 用户角色关系表
        /// </summary>
        public DbSet<UserRole> UserRole { get; set; }
        /// <summary>
        ///角色权限关系表
        /// </summary>
        public DbSet<RolePermission> RolePermissions { get; set; }



    }
}
